package person.zjh.kaoyansharehub.service;

import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import person.zjh.kaoyansharehub.dto.MaterialSaveDTO;
import person.zjh.kaoyansharehub.dto.PageMaterialDTO;
import person.zjh.kaoyansharehub.pojo.Material;
import person.zjh.kaoyansharehub.result.PageResult;
import person.zjh.kaoyansharehub.result.Result;
import person.zjh.kaoyansharehub.vo.MaterialVO;

import java.util.List;

/**
 * @description: 学习资料控制
 * @author 郑佳豪
 * @date 2025/2/13 16:24
 * @version 1.0
 */
public interface MaterialService {

    /**
     * 学习资料上传
     * @param requestParam 请求参数
     */
    Result<Void> saveMaterial(MaterialSaveDTO requestParam);

    /**
     * 考研资料分页查询
     * @param requestParam 请求参数
     */
    PageResult pageMaterial(PageMaterialDTO requestParam);

    MaterialVO queryMaterial(Long materialId);

    /**
     * 获取最新的八条文档资料
     */
    List<MaterialVO> getNewMaterialList(Long categoryId);

    /**
     * 获取用户上传的文章
     * @param requestParam
     */
    PageResult getUserPublishArticle(PageMaterialDTO requestParam);

    Result downloadFile(HttpServletRequest request, HttpServletResponse response, String filePath, Long materialId, Long userId);

    Result getUserPublishMaterialCount(Long userId);


}
